<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="/static/pear/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form">
    <div class="mainBox  layui-card-body" style="padding: 0 0;">
        <div class="main-container">
            <div class="layui-tab" lay-filter="TabBrief">
                <ul class="layui-tab-title">
                    <li class="layui-this">老师</li>
                    <li>学生</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label">收件人邮箱</label>
                            <div class="layui-input-block">
                                <input type="text" name="email" autocomplete="off" placeholder="请填写收件人邮箱" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">相关附件</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">《{$inf.title}》.ics</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">主题</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">{$inf.theme}</div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">内容</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">
                                    老师，您好:<br/>
                                    Dear Teacher,<br/>

                                    您有一门直播课《{$inf.title}》将于{$inf.start}开播，届时您可以使用PC Chrome 58 以上版本浏览器开启直播。<br/>
                                    Your live streaming course: ”{$inf.title}” will be started at {$inf.start}. Please start your course via PC Chrome browser(above version 58)  with below credentials:<br/>

                                    https://live.polyv.net/web-start/?channelId={$inf.channelId}<br/>

                                    建议您提前30分钟进入直播间进行设备调试和准备。<br/>
                                    Kindly Remind: Login broadcasting room 30 minutes in advance and test your camera / microphone device will be highly recommended<br/>

                                    您可以打开附件中的日历项文件，快捷地将其添加到您的日历中。<br/>
                                    You can open the calendar.ics as attached to add this course to your calendar.<br/>

                                    如果直播主讲人是外部讲师，请将此邮件转发给对应外部讲师，由外部讲师登录开启直播。<br/>
                                    If you are not host of this live streaming course, please forward this mail to the appropriate teacher, or contact training admin in your company.<br/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">收件人邮箱</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">课程所有已注册学员</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">相关附件</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">《{$inf.title}》.ics</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">主题</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">{$inf.theme}</div>
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">内容</label>
                            <div class="layui-input-block">
                                <div class="layui-form-mid layui-word-aux">
                                    学员 你好，<br/>
                                    Dear learner,<br/>

                                    您有一门直播课《{$inf.title}》将于{$inf.start}开播，届时请登录学习平台进入课程学习页面参与直播。<br/>
                                    Your live streaming course: ”{$inf.title}” will be started at {$inf.start}. Please login to mobile LMS to find and join this course.<br/>

                                    您可以打开附件中的日历项文件，快捷地将其添加到您的日历中。<br/>
                                    You can open the calendar.ics as attached to add this course to your calendar.<br/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {:token_field()}
            <input type="hidden" name="theme" value="{$inf.theme}">
            <input type="hidden" name="live_id" value="{$inf.id}">
            <input type="hidden" name="type" id="type" value="0">
        </div>
    </div>


    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{include file="_Fragment/javascript" /}
<script>
    layui.use(['form', 'jquery', 'element'], function() {
        let form = layui.form;
        let $ = layui.jquery;
        let element = layui.element;

        element.on('tab(TabBrief)', function(data) {
            $("#type").val(data.index);
        });

        form.on('submit(user-save)', function(data) {

            let loading = layer.load();
            $.ajax({
                url: '/Live/sendEmail',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function(result) {
                    layer.close(loading);
                    if (result.status == 0) {
                        layer.msg(result.msg, {
                            icon: 1,
                            time: 1000
                        }, function() {
                            parent.layer.close(parent.layer.getFrameIndex(window
                                .name)); //关闭当前页
                            parent.layui.table.reload("user-table");
                        });
                    } else {
                        layer.msg(result.msg, {
                            icon: 2,
                            time: 1000
                        });
                    }
                }
            })
            return false;
        });
    })
</script>
<script>
</script>
</body>
</html>